//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
   lunbo:"",
   items:""
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
    let that=this;
    wx.request({
      url: app.globalData.url+'home/rotationPicList', //仅为示例，并非真实的接口地址
      method: 'POST',
      header: {
        'content-type': 'application/json' // 默认值
      },
      success (res) {
        if(res.data.code==200){
          that.setData({
            lunbo:res.data.info
          })
        }
      }
    }),

    wx.request({
      url: app.globalData.url+'home/menuList', //仅为示例，并非真实的接口地址
      method: 'POST',
      header: {
        'content-type': 'application/json' // 默认值
      },
      success (res) {
        if(res.data.code==200){
          that.setData({
            items:res.data.info
          })
        }
      }
    })
  },
  getUserInfo: function(e) {
    console.log(e)
    app.globalData.userInfo = e.detail.userInfo
    this.setData({
      userInfo: e.detail.userInfo,
      hasUserInfo: true
    })
  }
})
